package com.binest.keyEvent.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.keyEvent.mapper.KeyEventMapper;
import com.binest.keyEvent.domain.KeyEvent;
import com.binest.keyEvent.service.IKeyEventService;

/**
 * 关键事件Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-23
 */
@Service
public class KeyEventServiceImpl implements IKeyEventService 
{
    @Autowired
    private KeyEventMapper keyEventMapper;

    /**
     * 查询关键事件
     * 
     * @param id 关键事件主键
     * @return 关键事件
     */
    @Override
    public KeyEvent selectKeyEventById(String id)
    {
        return keyEventMapper.selectKeyEventById(id);
    }

    @Override
    public List<KeyEvent> selectKeyEventListByInId(String inclousionId) {
        return keyEventMapper.selectKeyEventListByInId(inclousionId);
    }

    /**
     * 查询关键事件列表
     * 
     * @param keyEvent 关键事件
     * @return 关键事件
     */
    @Override
    public List<KeyEvent> selectKeyEventList(KeyEvent keyEvent)
    {
        return keyEventMapper.selectKeyEventList(keyEvent);
    }

    /**
     * 新增关键事件
     * 
     * @param keyEvent 关键事件
     * @return 结果
     */
    @Override
    public int insertKeyEvent(KeyEvent keyEvent)
    {
        keyEvent.setCreateTime(DateUtils.getNowDate());
        return keyEventMapper.insertKeyEvent(keyEvent);
    }

    /**
     * 修改关键事件
     * 
     * @param keyEvent 关键事件
     * @return 结果
     */
    @Override
    public int updateKeyEvent(KeyEvent keyEvent)
    {
        keyEvent.setUpdateTime(DateUtils.getNowDate());
        return keyEventMapper.updateKeyEvent(keyEvent);
    }

    /**
     * 批量删除关键事件
     * 
     * @param ids 需要删除的关键事件主键
     * @return 结果
     */
    @Override
    public int deleteKeyEventByIds(String[] ids)
    {
        return keyEventMapper.deleteKeyEventByIds(ids);
    }

    /**
     * 删除关键事件信息
     * 
     * @param id 关键事件主键
     * @return 结果
     */
    @Override
    public int deleteKeyEventById(String id)
    {
        return keyEventMapper.deleteKeyEventById(id);
    }
}
